package com.outsource.framework.model.repository;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import com.outsource.framework.domain.Tyonghu;

public interface TyonghuRepository extends CrudRepository<Tyonghu, Integer>, JpaSpecificationExecutor<Tyonghu>{

	@Query(value="select * from t_yonghu where id = :id",nativeQuery = true)
	Tyonghu getById(@Param("id")Integer id);
	@Query(value="select * from t_yonghu where mobile = :mobile and password = :password ",nativeQuery = true)
	Tyonghu login(@Param("mobile")String mobile,@Param("password")String password);
	@Query(value="select `password` from t_yonghu where mobile = :mobile",nativeQuery = true)
	String getByPasswords(@Param("mobile")String mobile);
	@Query(value="select * from t_yonghu where mobile = :mobile",nativeQuery = true)
	Tyonghu getByYh(@Param("mobile")String mobile);
}
